package com.map.hashmap;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.Set;

public class CompareHashMap {
public static void main(String[] args) {
	HashMap<String, String> hMap=new HashMap<String, String>();
	hMap.put("1", "one");
	hMap.put("2", "two");
	hMap.put("3", "three");
	hMap.put("4", "four");
	
	HashMap<String, String> hMap2=new HashMap<String, String>();
	hMap2.put("1", "one");
	hMap2.put("2", "two");
	
	HashMap<String, String> hMap3=new HashMap<String, String>();
	Set<String> set1=hMap.keySet();
	Set<String> set2=hMap2.keySet();
	
	Iterator<String> iter1=set1.iterator();
	Iterator<String> iter2=set2.iterator();
	for(Entry<String, String> entry: hMap.entrySet()){
		if(!hMap2.containsKey(entry.getValue())){
			hMap3.put(entry.getKey(), entry.getValue());
		}
		System.out.println("map3 "+hMap3);
	}
	
	
}
}
